package org.blueoxygen.kukuruyuk.actions.location;
import java.util.ArrayList;
import java.util.List;
import org.blueoxygen.cimande.persistence.PersistenceAware;
import org.blueoxygen.cimande.persistence.PersistenceManager;
import org.blueoxygen.kukuruyuk.entity.Location;
import org.blueoxygen.kukuruyuk.actions.location.ListLocation;

import com.opensymphony.xwork2.ActionSupport;
public class ListLocation extends ActionSupport 
implements PersistenceAware {
	private PersistenceManager manager ;
	private  List<ListLocation> locations = new ArrayList<ListLocation>();
	
	@Override
	public String execute () throws Exception {
			setLocations(manager.getList("SELECT p FROM " + Location.class.getName()
					+ " p WHERE p.logInformation.activeFlag=1", null, null));
			return SUCCESS;
	}
	@Override
	public void setPersistenceManager(PersistenceManager arg0){
			this.manager = arg0;
	
	}
	public PersistenceManager getManager() {
		return manager;
	}
	public void setManager(PersistenceManager manager) {
		this.manager = manager;
	}
	public List<ListLocation> getLocations() {
		return locations;
	}
	public void setLocations(List<ListLocation> locations) {
		this.locations = locations;
	}


}
